<template>
  <div class="explain">
    <img src="@/assets/img/icon_gb1.png" class="close" @click="hide" />
      <div class="title_close">
        <!-- 美股盘前盘后详情 -->
        <div class="title">{{list.title}}</div>
      </div>
      <div class="tipContent" v-html="list.content"></div>
  </div>
</template>

<script>
import {get_explain} from '@/assets/js/API/info.js';
export default {
  props: {
    type: Number,
  },
  data() {
    return {
      list: []
    }
  },
  mounted() {
    this.getTip();
  },
  methods: {
    hide() {
      this.$emit("hidePan")
    },
    async getTip() {
      if(this.type == "") return
      const res = await get_explain({
          pageId : this.type
        });
      if(res.code != 1) return this.$message.error(res.msg);
      this.list = res.data;
    }
  },
  watch: {
    "$route.name"(val) {
      console.log(val,"路由")
    }
  }
}
</script>

<style lang="less">
@import "~@/assets/less/tip_dialog.less";
.explain {
  position: relative;
  .close {
    position: absolute;
    height: 18px;
    right: 0;
    top: 5px;
  }
  .title {
    padding-bottom: 10px;
    // padding-top: 10px;
  }
  .tipContent {
    height: 65vh;
    overflow: auto;
    padding-left: 10px;
    padding-right: 10px;
  }
}
</style>